 var orderNumber = getvl("orderNumber");
 
 $(function(){
 	  if(orderNumber!=''){
 	  	dingdanbianhao(orderNumber);
 	  }else{
 	  	alert("无传入值");
 	  }
 });
 
 
 function dingdanbianhao(){
     $.ajax({
			url: urlcore + "/api/order/selectOrder?orderNumber="+orderNumber,
			type: "get",
			dataType: 'json',
			contentType: "application/json;charset=utf-8",
			success:function(data){
				if(data.success == true) {
					var da=data.data;
					var yunshustataus="";
					if(data.data.status!=2){
						yunshustataus="运输中";
					}else{
						yunshustataus="已收货";
					}
					$("#zhuangtai").html(yunshustataus);
					//alert(JSON.stringify(da.shop));
                 var shangping='<img onerror="errorImg2(this)" src="'+da.shop.headImg+'" />';
			    var wuliuxinxi='<li>快递名称：<span>'+da.express.companyName+'</span></li>'+
'    			<li>运单编号：<span>'+da.express.expressNumber+'</span></li>';
/*'    			<li>官方电话：<a href="tel:110;">'+da.companyName+'</a></li>';
*/                 $("#wuliuxinxi").append(wuliuxinxi);
					$("#shangping").append(shangping);
					kuaidi(da.express.expressNumber,da.express.brandName);
				}else{
					alert("异常");
				}
			},
			error:function() {
				alert("error");
			}
		});
 
 }
 
 
 
 
 
 function dingdanyuliu(orderNumber){
     $.ajax({
			url: urlcore + "/api/express/lookups?orderNumber="+orderNumber,
			type: "get",
			dataType: 'json',
			contentType: "application/json;charset=utf-8",
			success:function(data){
				if(data.success == true) {
					var da=data.data.express;
					var yunshustataus="";
					if(data.data.yunshustataus==1){
						yunshustataus="运输中";
					}else{
						yunshustataus="已收货";
					}
					$("#zhuangtai").html(yunshustataus);
                 var shangping='<img src="'+data.data.goodsurl+'" />';
			    var wuliuxinxi='<li>快递名称：<span>'+da.companyName+'</span></li>'+
'    			<li>运单编号：<span>'+da.expressNumber+'</span></li>';
/*'    			<li>官方电话：<a href="tel:110;">'+da.companyName+'</a></li>';
*/                 $("#wuliuxinxi").append(wuliuxinxi);
					$("#shangping").append(shangping);
					kuaidi(da.expressNumber,da.brandName);
				}else{
					alert("异常");
				}
			},
			error:function() {
				alert("error");
			}
		});
 }
 
 
 function kuaidi(danhao,beiming){
 	    $.ajax({
        url:  urlcore + "/api/order/Logistics",
        type: "post",
        contentType: "application/json;charset=utf-8",
        data: JSON.stringify({
            "LogisticCode": danhao,
            "ShipperCode": beiming
        }),
        dataType: "json",
        success:function(data){
            if (data.success == true) {
            	 var wuliu="";
            	wuliu+='<ul>';
            	if(data.data.traces!=""){
           $.each(data.data.traces, function(y,n) {
            wuliu+='<li>'+
'            <div>'+
'                <h5>'+n.acceptStation+'</h5>'+
'                <span>'+n.acceptTime+'</span>'+
'            </div>'+
'        </li>';
               //  $("#wuliu").append(wuliu);
            	});
            	
            	}else{
            		 
            	 wuliu+='<li>'+
            	 '            <div>'+
'                <h5></h5>'+
'                <span>暂无物流信息</span>'+
'            </div>'+
            	 '</li>';
            		
            	}     
            	wuliu+='</ul>';
            	 $(".public_wuliu").append(wuliu);
            } else if (data.code == 'OVERTIME') {
                var thisUrl = window.location.href;
                if (thisUrl.indexOf('login.html') <= -1) {
                    top.window.location.href = "login.html";
                }
            } else {
                alert(data.msg);
            }
        },
        error: function() {
            alert("error");
        }
 	    });
 }
 